<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>
</head>
<body class="page-header-fixed">
<jsp:include page="../common/header.jsp"/>

<div class="clearfix">
</div>
<div class="page-container">
    <div class="page-sidebar-wrapper"><jsp:include page="../common/menu.jsp"/></div>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <form class="form-horizontal form-row-seperated" id="form" method="post" action="${path}/examQuestions/save">
                        <div class="portlet box purple">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-shopping-cart"></i>题目详细内容
                                </div>
                                <div class="actions btn-set">
                                    <a href="javascript:history.go(-1);" class="btn default"><i
                                            class="fa fa-angle-left"></i> 返回</a>
                                    <button type="button" onclick="save()" class="btn blue"><i class="fa fa-check"></i> 保存
                                    </button>
                                </div>
                            </div>
                            <div class="portlet-body">
                                <div class="tabbable">
                                    <div class="tab-content no-space">
                                        <div class="tab-pane active" id="tab_general">
                                            <div class="form-body">
                                                 <div class="form-group">
                                                    <label class="col-md-2 control-label">所属投票:
                                                        <span class="required">*</span>
                                                    </label>
                                                    <div class="col-md-3">
                                                      	<select id="projectId" name="projectId" class="form-control">
			                                               <option value="0" selected="selected">请选择</option>
																<c:forEach items="${datalists}" var="datalist">
																	<option value="${datalist.id }"  <c:if test="${data.projectId==datalist.id}">selected="selected" </c:if>>${datalist.name }</option>
																</c:forEach>
                                           				</select>
                                                    </div>
                                                </div>
                                                
                                                <div class="form-group">
                                                    <label class="col-md-2 control-label">题目名字:
                                                    	<span class="required">*</span>
                                                    </label>

                                                    <div class="col-md-5">
                                                        <input type="text" id="questionName" name="questionName"
                                                               class="form-control measure-input" 
                                                               value="${data.questionName}"/>
                                                    </div>
                                                    <div class="col-md-5">
<!--                                                         &nbsp;可输入<b><span id="title_len">32</span></b> 个字符 -->
                                                    </div>
                                                </div>
                                                
                                                     <div class="form-group">
                                                    <label class="col-md-2 control-label">是否单选:（是：代表单选，否：代表多选）
                                                    </label>

                                                    <div class="col-md-5">
                                                   
                                                     <select name="isRadio"  id="isRadio" class="form-control measure-select"   style="width: 60px;">
                                                     <option value="1">是</option>
                                                          <option  value="2">否</option>
                                                     </select>
                                                    </div>
                                                </div>
                                             
                                                
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="portlet-title">
                                <div class="actions btn-set">
                                    <a href="javascript:history.go(-1);" class="btn default"><i
                                            class="fa fa-angle-left"></i> 返回</a>
                                    <button type="button" onclick="save()" class="btn blue"><i class="fa fa-check"></i> 保存
                                    </button>
                                </div>
                            </div>
                        </div>
                        <input type="hidden" id="id" name="id" value="${data.id}">
                        <input type="hidden" id="sort" name="sort" value="${data.sort}">
                         <input type="hidden" id="labelName" name="labelName" >
                        <input type="hidden" id="insertTime" name="insertTime" class="form-control" value="${data.insertTime}" /> 
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/kindergarten/js/basic.js"></script>
<script type="text/javascript" src="${path}/evaluationManage/js/examQuestions.js"></script>
<script>
	$(function () {
	/*	if(${null != data.id}){ //修改
			queryAllProjectjp(${data.projectId});
			queryAllLabel("${data.labelName}");
		}else{
			alert(${data.projectId})
			queryAllProjectjp(${data.projectId});
			queryAllLabel(null);
		}*/
	});
	

    function save() {
    	//非空验证
    	if($("#projectId").val()==""){
    		alert("所属项目不能为空!");
            return;
    	}else if("" == $("#questionName").val()){
    		alert("题干不能为空!");
    		return;
    	}
		
    	$("#form").submit();
}   
	var va='${data.isRadio}';

    $("#isRadio").find("option[value='"+va+"']").attr("selected",true);

    
</script>
</body>
</html>